<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [1,2,3,4];
        var res = arr.push(5);
        console.log(res,arr);

        // join 将数组拼接成字符串
        var arr = [1,2,3,4,5];
        // var str = arr.join('-');// 用-将数据中的每一个元素进行链接
        var str = arr.join('');
        console.log(str);


        var str2 = '1-2-3-4-5';
        var arr2 = str2.split('-');
        console.log(arr2,typeof arr2);

        var str3 = '12345';
        var arr3 = str3.split('');
        console.log(arr3);


        var n = 1;
        var m = 2;
        var arr4 = [n,m];
        console.log(arr4);

        var arr5 = [7,8,9,10];
        var arr6 = [1,2,3,4,5,6];
        var arr7 = [...arr6,...arr5];
        console.log(arr7);

    </script>
</body>
</html>